package com.liuyk.activity;

import android.view.View;
import android.widget.RelativeLayout;

/**
 *
 * Created by Administrator on 2015/7/1.
 */
public class WarpView {

    private View view;
    private int width;
    private int height;

    private final RelativeLayout.LayoutParams params;

    public WarpView(View view) {
        this.view = view;
        params = (RelativeLayout.LayoutParams) view.getLayoutParams();
    }

    public View getView() {
        return view;
    }

    public void setView(View view) {
        this.view = view;
    }

    public int getWidth() {
        return view.getLayoutParams().width;
    }

    public void setWidth(int width) {
        this.width = width;

        params.width = width;
        view.setLayoutParams(params);
//        view.requestLayout();//刷新view
    }

    public int getHeight() {
        return view.getLayoutParams().height;
    }

    public void setHeight(int height) {
        this.height = height;
        view.getLayoutParams().height = height;
//        view.requestLayout();
    }
}
